﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Console开放封闭原则
{
    public class BankProcess3
    {


    }

    // 封装是变化
    // 变化的原因
    // 根据不同的需求，返回不同的处理对象 / 处理方法

    public interface IBankClient
    {
        IBankProcess GetBankProcess();
    }

    public class DepositeClient : IBankClient
    {
        public IBankProcess GetBankProcess()
        {
            return new DepostieClass02();
        }
    }

    public class DrawMoneyClient : IBankClient
    {
        public IBankProcess GetBankProcess()
        {
            return new DrawMoneyClass02();
        }
    }
    public class TransferClient : IBankClient
    {
        public IBankProcess GetBankProcess()
        {
            return new TransferClass02();
        } 
    }
}
